package com.zimin.mapper;

import com.baomidou.mybatisplus.core.toolkit.AES;

/**
 * @author zimin
 * @since 2021/12/17 11:07 上午
 */
public class Test {
    public static void main(String[] args) {
        //      jdbc:mysql://127.0.0.1:3306/zimin-cloud?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=UTC
        // 生成 16 位随机 AES 密钥
        String randomKey = AES.generateRandomKey();
        System.out.println(randomKey);
        // 随机密钥加密
        String root = AES.encrypt("root", randomKey);
        String password = AES.encrypt("123456", randomKey);
        String url = AES.encrypt("jdbc:mysql://127.0.0.1:3306/zimin-cloud?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=GMT+8", randomKey);
//        jdbc:mysql://127.0.0.1:3306/zimin-cloud?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=GMT+8
//        TU0ICbpbh4Dpmt7fXa2PGjozhepwSngfo0wBBBAU2nPnnI91mDObZlVyKi8GSgWctH4v9JvPpM3X4zXMS/E3JfRZYRqtr9D+Mu5THYNyhW2MkPd/Jky2EyTm5VJtOjeuJg7jSd+BZ5ytLxnZRPcyplaO93dLmdZ5P3eEZU0od88=
        System.out.println(root);
        System.out.println(password);
        System.out.println(url);
    }
}
